package com.alibaba.feign;

import com.alibaba.domain.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFeignClientFallback implements UserFeign{

    //日志打印器
    private Logger log = LoggerFactory.getLogger(UserFeignClientFallback.class);

    @Override
    public User getUserById(Long id) {
        log.info("用户服务不可用");
        //托底数据
        return new User(-1l,"无此用户","用户服务不可用");
    }
}
